package com.cci.kangdao.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cci.kangdao.dao.GMApplyRecordFlowDao;
import com.cci.kangdao.service.GMApplyRecordFlowService;

@Service
public class GMApplyRecordFlowServiceImpl implements GMApplyRecordFlowService {
	
	@Autowired
	private GMApplyRecordFlowDao gMApplyRecordFlowDao;
	
	
	@Transactional
	public int saveApplyRecordFlow(Long recordID, Integer recordStatus, String desc, Long companyID, Long stationID, Long creator, String createTime) {
		return saveApplyRecordFlow(recordID, recordStatus, desc, companyID, stationID, creator, createTime, null);
	}
	
	
	@Transactional
	public int saveApplyRecordFlow(Long recordID, Integer recordStatus, String desc, Long companyID, Long stationID, Long creator, String createTime, Integer roundTimes) {
		Map<String, Object> map = new HashMap<>(8);
		map.put("ApplyRecordID", recordID);
		map.put("ApplyRecordStatus", recordStatus);
		map.put("Description", desc);
		map.put("CompanyID", companyID);
		map.put("ServiceStationID", stationID);
		map.put("RoundTimes", roundTimes);
		map.put("Creator", creator);
		map.put("CreateTime", createTime);
		return saveApplyRecordFlow(map);
	}
	
	
	@Transactional
	public int saveApplyRecordFlow(Map<String, Object> recordFlow) {
		return gMApplyRecordFlowDao.insertSelective(recordFlow);
	}
	
	
	

	@Override
	public Map<String, Object> getNewestApplyRecordFlowByRecordId(Long recordId) {
		return gMApplyRecordFlowDao.getNewestApplyRecordFlowByRecordId(recordId);
	}
	
	
	
	
}
